﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dynamodb.xUnit
{
    public static class DateUtil
    {
        /// <summary>
        /// 比较时间，截至到秒，忽略毫秒
        /// </summary>
        /// <param name="dt1"></param>
        /// <param name="dt2"></param>
        /// <returns></returns>
        public static bool EqualUpToSecond(this DateTime dt1, DateTime dt2)
        {
            var span = dt1 - dt2;
            return span.TotalSeconds == 0;
        }
    }
}
